package org.lsms.servlet;

/**
 * servlet used to pass paper
 * @author ZhanXueliang
 * 2010.9.1
 */

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.lsms.dao.impl.DaoImpl;

public class pass_paper extends HttpServlet {

	
	public void destroy() {
		super.destroy(); 
	}

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
			this.doPost(request, response);
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
			
			int paper_id = Integer.parseInt(request.getParameter("paper_id"));
			
			DaoImpl impl = new DaoImpl();
			
			if(impl.update_paper_status(1, paper_id)){
				response.sendRedirect("chair/chair_decision.jsp");
			}else{
				response.sendRedirect("chair/chair_decision.jsp");
			}
	}

	public void init() throws ServletException {

	}

}
